//package com.example.demo.config;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.CorsRegistry;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//
//@Configuration
//public class WebConfigurer implements WebMvcConfigurer {
//
////    @Autowired
////    private AdminLoginInterceptor adminLoginInterceptor;
////
////    @Autowired
////    private UserLoginInterceptor userLoginInterceptor;
////
////    @Autowired
////    private sfh_StudentLoginInterceptor Sfh_StudentLoginInterceptor;
////
////    @Autowired
////    private tfh_TeacherLoginInterceptor teacherLoginInterceptor;
////
////    @Autowired
////    private hw_AdminLoginInterceptor hw_adminLoginInterceptor;
////
////    @Autowired
////    private TrainingSystemInterceptor trainingSystemInterceptor;
//
//
//    @Override
//    public void addCorsMappings(CorsRegistry registry) {
//        registry.addMapping("/**")
//                .allowedOrigins("*")
//                .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
//                .allowCredentials(true)
//                .maxAge(3600)
//                .allowedHeaders("*");
//    }
//
//    // 用来配置静态资源的，比如html，js，css，等等
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//    }
//
//    // 这个方法用来注册拦截器，我们自己写好的拦截器需要通过这里添加注册才能生效
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
////        System.out.println("到addInterceptors");
//        //考试系统教师
////        registry.addInterceptor(adminLoginInterceptor).addPathPatterns("/admin/**")
////                .addPathPatterns("/Login/isAdminLogin")
////                .excludePathPatterns("/Login/adminLogin")
////                .excludePathPatterns("/Login/userLogin")
////                .excludePathPatterns("/admin/getSystemStatus");
//
//        //考试系统考生
////        registry.addInterceptor(userLoginInterceptor).addPathPatterns("/user/**")
////                .addPathPatterns("/Login/isUserLogin")
////                .excludePathPatterns("/Login/userLogin").excludePathPatterns("/Login/adminLogin");
//
//        //作业系统学生
////        registry.addInterceptor(Sfh_StudentLoginInterceptor).addPathPatterns("/sfh_baseInfo/**");
//
//        //作业系统教师
////        registry.addInterceptor(teacherLoginInterceptor).addPathPatterns("/teacher/**")
////                .excludePathPatterns("/teacher/createTClass")
////                .excludePathPatterns("/teacher/assignHomework")
////                .excludePathPatterns("/teacher/addNclassFromTclass")
////                .excludePathPatterns("/teacher/editTClassByClassId")
////                .excludePathPatterns("/teacher/delNclassFromTclass")
////                .excludePathPatterns("/teacher/findTClassByTeacherId")
////                .excludePathPatterns("/teacher/findHomeworkBytClassId")
////                .excludePathPatterns("/teacher/getCurrentSubmission");
//
//        //作业系统管理员
////        registry.addInterceptor(hw_adminLoginInterceptor).addPathPatterns("/hwAdmin/**").excludePathPatterns("/hwAdmin/syncStuData");
////
////        registry.addInterceptor(trainingSystemInterceptor).addPathPatterns("/training/**")
////                .excludePathPatterns("/training/user/register")
////                .excludePathPatterns("/training/user/login")
////                .excludePathPatterns("/training/user/logout/**")
////                .excludePathPatterns("/training/user/reset-password")
////                .excludePathPatterns("/training/user/is-email-exist/**")
////                .excludePathPatterns("/training/user/is-email-exist/**")
////                .excludePathPatterns("/training/user/sendEmail")
////                .excludePathPatterns("/training/submission/getNumberOfSubmissionsGroupByDay")
////                .excludePathPatterns("/training/submission/getLatestSubmissions")
////                .excludePathPatterns("/training/submission/getNumberOfSubmissionsGroupByDayAndLanguage")
////                .excludePathPatterns("/training/getProblemByCondition")
////                .excludePathPatterns("/training/getAllCategory")
////                .excludePathPatterns("/training/upload");
//    }
//}
